import java.util.Arrays;
import java.util.Random;

/**
 * @Author ZhangCuirong
 * @Date 2025/9/18 15:02
 * @description:
 */
public class Solution384 {
    private final int[] nums;
    private final Random rand = new Random();

    public Solution384(int[] nums) {
        this.nums = nums;
    }

    public int[] reset() {
        return nums;
    }

    public int[] shuffle() {
        int n = nums.length;
        int[] copy = Arrays.copyOf(nums, n);
        for (int i = 0; i < n; i++) {
            int r = i + rand.nextInt(n - i);
            swap(copy, i, r);
        }
        return copy;
    }
    public void swap(int[] nums, int i, int j) {
        int temp = nums[i];
        nums[i] = nums[j];
        nums[j] = temp;
    }
}
